package view.skin
{
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.GradientType;
	import flash.display.Graphics;
	
	import mx.skins.halo.TitleBackground;
	import mx.utils.ColorUtil;
	
	public class TitleBlueSkin extends TitleBackground
	{
		[Embed(source="/assets/ct_titleBg_skyblue.png")]
		private var _backgroundImageClass:Class;
		private var _backgroundBitmapData:BitmapData;
		private var _backgroundImage:Bitmap;
		private var _backgroundColor:uint;
		
		public function TitleBlueSkin()
		{
			_backgroundImage = new _backgroundImageClass();
			_backgroundBitmapData = new BitmapData(_backgroundImage.width, _backgroundImage.height);
		}
		
		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
		{
			super.updateDisplayList(unscaledWidth, unscaledHeight);
		
			var cornerRadius:Number = getStyle("cornerRadius");
			
			_backgroundBitmapData.draw(_backgroundImage);
			graphics.clear();
			graphics.beginBitmapFill(_backgroundBitmapData, null, false, false);
			
			// specify corner radius here
			this.graphics.drawRoundRectComplex(0, 0, this.width, this.height, cornerRadius, cornerRadius, 0, 0);
		}
		
	}
}